This application is based on Japanese patent application No. 10-81323 filed on Mar. 27, 1998, the entire contents of which are incorporated herein by reference.
a) Field of the Invention
The present invention relates to a communication technique, more particularly to a technique for communicating time information.
b) Description of the Related Art
There is a standard for communication among electronic musical instruments called Musical Instrument Digital Interface (MIDI). An electronic musical instrument having a MIDI standardized interface can be connected to other electronic musical instruments via MIDI cables. This connection enables the instruments to communicate MIDI data from each other via the MIDI cables. For example, a player plays a musical piece with one electronic musical instrument and the instrument transmits MIDI data representing the played musical piece to another electronic musical instrument, and the instrument which receives the MIDI data can reproduce the musical piece. That is, connected electronic musical instruments can simultaneously reproduce a musical piece which is played by a player with one instrument.
A communication network connecting a plurality of general purpose computers enables the connected computers to communicate various information with each other. For example, a computer stores information like audio data (representing notes produced by non-electronic musical instruments), MIDI data, or the like in its hard disk drive or the like and transmits the information to other computers via the communication network. The computer which receives the information can store the received information in its storage device such as a hard disk drive. Such a general purpose computer communication network can be a medium for communicating information among computers, however, its property differs from that of the MIDI network.
The MIDI standard realizes real time communication among the electronic musical instruments, however, it is not suitable for long distance communication and communication among multiple nodes. On the contrary, the general purpose computer network is suitable for the long distance communication and communication among multiple nodes, however, it is not designed for the real time communication among the electronic musical instruments.
In case of communicating time information via the general purpose computer network, each of a transmitter and a receiver connected to the general purpose computer network has its own timer which generates time information representing date and time. Since the timers in the transmitter and the receiver are generally not synchronized with each other, both time information values do not always coincide with each other.
In other words, the time information value sent from the transmitter does not always coincide with the receiver""s own time information value. In such a case, various problems may occur when the receiver executes data processing in accordance with the received time information.
On the other hand, since the general purpose computer network is used for the long distance communication and data go through various routes on the network, time periods for communicating data packets are not always the same. Such differences in the time periods may influence the data processing in the receiver if it is performed in accordance with the received time information.
It is an object of the present invention to provide a communication device, a communication method, and a medium recording a program all of which improve the reliability of time information communication.
According to one aspect of the present invention, there is provided a communication device comprises:
a receiver which receives externally supplied first time information representing time;
a time information generator which generates second time information representing time;
a time difference detector which detects a time difference between the times represented by the received first time information and the second time information generated at a time point at which the first time information is received; and
a corrector which corrects the second time information generated by said time information generator based on the received first time information when the time difference is greater than a predetermined value.
The first time information is generated by an external transmitter and a receiver receives the first time information from the transmitter. The second time information is generated by the time information generator. The first time information data and the second time information data are not always synchronous with each other. When the detected time difference between times represented by the first time information and the second time information exceeds a predetermined value, the second time information is corrected, so that the time difference between the times represented by the first time information and the second time information is reduced.
Accordingly, even if the first time information received from the external transmitter is not synchronized with the second time information generated by the receiver, the second time information is corrected based on the detected time difference between the times represented by thee first time information and the second time information. This correction prevents problems caused by the time difference between the times represented by the first time information and the second time information.